<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style type="text/css">
	div{width:100px; height: 100px; border: 2px solid #000; padding: 10px; margin: 6px;}
</style>
<script type="text/javascript">
window.onload = function (){
	var oDiv = document.getElementsByTagName('div')[0];
/*
	width height
	style.width:样式宽			//100px
	clientWidth:可视区宽		//120	样式宽 + padding	(无margin)
	offsetWidth:占位宽			//122	样式宽 + padding + border	(无margin)
*/
alert(oDiv.style.width);
alert(oDiv.clientWidth);
alert(oDiv.offsetWidth);
}
</script>
</head>
<body>
	<div></div>
</body>
</html>